@import "selectors";

@mixin hide-scrollbar() {
  scrollbar-width: none; /* Firefox 64 */
  -ms-overflow-style: none; /* Internet Explorer 11 */
  &::-webkit-scrollbar { /** WebKit */
    display: none;
  }
}

@mixin hideNativeScrollbar {
  @include viewport {
    @include hide-scrollbar();
  }

  // Hide native horizontal scrollbar if visible
  @include scrollbarXUsed {
    @include nativeScrollbarHider {
      bottom: var(--native-scrollbar-size);
    }
  }

  // Hide native vertical scrollbar if visible
  @include scrollbarYUsed {
    @include nativeScrollbarHider {
      left: 0;
      right: var(--native-scrollbar-size);
    }

    @include rtl {
      @include nativeScrollbarHider {
        right: 0;
        left: var(--native-scrollbar-size);
      }
    }
  }
}

::ng-deep {
  /* A class used to measure native scrollbar size */
  .ng-scrollbar-measure {
    @include hide-scrollbar();
  }
}
